import ajax from "./ajax";


//首页数据加载 api.index.get_index
export function api_index_get_index() {
	return ajax('api.index.get_index')
}


//今日掌柜 橱窗数据 api.index.get_chuchuang_pic
export function api_index_get_chuchuang_pic() {
	return ajax('api.index.get_chuchuang_pic')
}




// 商品详情 goods.detail
export function goods_detail(data) {
	return ajax('goods.detail', data);
	//data {openid, id}
}

//member.favorite.toggle
export function member_favorite_toggle(data) {
	return ajax('member.favorite.toggle', data)
}

//member.cart.add
export function member_cart_add(data) {
	return ajax('member.cart.add', data)
}


//获取确认订单数据  order.create
export function order_create(data) {
	return ajax('order.create', data)
}
// member.address
export function member_address(openid) {
	return ajax('member.address', {
		openid
	})
}
// member.address.post
export function member_address_post(data) {
	return ajax('member.address.post', data)
}

// order.create.submit
export function order_create_submit(data) {
	return ajax('order.create.submit', data)
}
// 收银台组合支付  order.payorder.pay
export function order_pay(data) {
	return ajax('order.pay', data)
}

//立即支付 order.pay.complete
export function order_pay_complete(data) {
	return ajax('order.pay.complete', data)
}


//order.pay.success
export function order_pay_success(data) {
	return ajax('order.pay.success', data)
}

//api.index.order_check 
export function api_index_order_check(data) {
	return ajax('api.index.order_check', data)
}

// api.index.goods_search
export function api_index_goods_search(data) {
	return ajax('api.index.goods_search', data)
}

//积分签到 sign.dosign
export function sign_dosign(openid) {
	return ajax('sign.dosign', {
		openid
	}, true, false)
}

//获取签到信息 sign
export function sign(openid) {
	return ajax('sign', {
		openid
	})
}

//获取分类列表 api.index.get_goods_cate_list
export function api_index_get_goods_cate_list() {
	return ajax('api.index.get_goods_cate_list')
}

//惠享 所有商品数据返回（筛选） api.index.get_goods_list
export function api_index_get_goods_list(data) {
	return ajax('api.index.get_goods_list', data)
}

export function goods_picker(data) {
	return ajax('goods.picker', data)
}


// 获取app版本号  acommsion.getappversion
export function acommsion_getappversion() {
	return ajax('acommsion.getappversion')
}
//commission.qrcode.getXieyiInfo 获取协议图片
export function commission_qrcode_getXieyiInfo(openid) {
	return ajax('commission.qrcode.getXieyiInfo', {
		openid
	})
}

//commission_qrcode_xieyi 协议签署
export function commission_qrcode_xieyi(data) {
	return ajax('commission.qrcode.xieyi', data)
}

//api.index.get_real_name 是否实名
export function api_index_get_real_name(mobile) {
	return ajax('api.index.get_real_name', {
		mobile
	})
}